# Created by 黄景涛
# DATE: 2024/11/13

""" 查询现有组织下的用户，并把(username、密码)写入yaml文件"""

import yaml

from reset_password import search_users_from_org


if __name__ == '__main__':
    org_id = 3
    users = search_users_from_org(org_id)
    usernames = dict.fromkeys(map(lambda item: item[-1].strip(), users), 'Bk@123456')
    with open('user_files/search_users.yaml', mode='w', encoding='utf8') as f:
        yaml.dump(usernames, f)
        print('search_users.yaml写入成功！')


